package com.ruoyi.system.service.impl;

import java.util.List;

import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.HoDormitoryInfoMapper;
import com.ruoyi.system.domain.HoDormitoryInfo;
import com.ruoyi.system.service.IHoDormitoryInfoService;

/**
 * 宿舍信息Service业务层处理
 *
 * @author ruoyi
 * @date 2025-01-10
 */
@Service
public class HoDormitoryInfoServiceImpl implements IHoDormitoryInfoService {
    @Autowired
    private HoDormitoryInfoMapper hoDormitoryInfoMapper;

    /**
     * 查询宿舍信息
     *
     * @param id 宿舍信息主键
     * @return 宿舍信息
     */
    @Override
    public HoDormitoryInfo selectHoDormitoryInfoById(Long id) {
        return hoDormitoryInfoMapper.selectHoDormitoryInfoById(id);
    }

    /**
     * 查询宿舍信息列表
     *
     * @param hoDormitoryInfo 宿舍信息
     * @return 宿舍信息
     */
    @Override
    public List<HoDormitoryInfo> selectHoDormitoryInfoList(HoDormitoryInfo hoDormitoryInfo) {
        return hoDormitoryInfoMapper.selectHoDormitoryInfoList(hoDormitoryInfo);
    }

    @Override
    public List<HoDormitoryInfo> queryHoDormitoryInfoList(HoDormitoryInfo hoDormitoryInfo) {
        return hoDormitoryInfoMapper.queryHoDormitoryInfoList(hoDormitoryInfo);
    }

    /**
     * 新增宿舍信息
     *
     * @param hoDormitoryInfo 宿舍信息
     * @return 结果
     */
    @Override
    public int insertHoDormitoryInfo(HoDormitoryInfo hoDormitoryInfo) {
        hoDormitoryInfo.setCreateTime(DateUtils.getNowDate());
        return hoDormitoryInfoMapper.insertHoDormitoryInfo(hoDormitoryInfo);
    }

    /**
     * 修改宿舍信息
     *
     * @param hoDormitoryInfo 宿舍信息
     * @return 结果
     */
    @Override
    public int updateHoDormitoryInfo(HoDormitoryInfo hoDormitoryInfo) {
        hoDormitoryInfo.setUpdateTime(DateUtils.getNowDate());
        return hoDormitoryInfoMapper.updateHoDormitoryInfo(hoDormitoryInfo);
    }

    /**
     * 批量删除宿舍信息
     *
     * @param ids 需要删除的宿舍信息主键
     * @return 结果
     */
    @Override
    public int deleteHoDormitoryInfoByIds(Long[] ids) {
        return hoDormitoryInfoMapper.deleteHoDormitoryInfoByIds(ids);
    }

    /**
     * 删除宿舍信息信息
     *
     * @param id 宿舍信息主键
     * @return 结果
     */
    @Override
    public int deleteHoDormitoryInfoById(Long id) {
        return hoDormitoryInfoMapper.deleteHoDormitoryInfoById(id);
    }
}
